package com.hg.junit.api;

import org.junit.Before;
import org.junit.Test;
import junit.framework.TestCase;

//测试样例定义了运行多重测试的固定格式
public class MyTestCase extends TestCase {
    protected double fValue1;
    protected double fValue2;

    @Before
    public void setUp() {
        fValue1 = 2.0;
        fValue2 = 3.0;
    }

    @Test
    public void test1() {
        System.out.println("test1");
    }

    @Test
    public void testAdd() {
        //count the number of test cases
        System.out.println("No of Test Case = " + this.countTestCases());

        //test getName
        String name = this.getName();
        System.out.println("Test Case Name = " + name);

        //test setName
        this.setName("testNewAdd");
        String newName = this.getName();
        System.out.println("Updated Test Case Name = " + newName);
    }

    @Test
    public void test2() {
        System.out.println("test2");
    }

    //tearDown used to close the connection or clean up activities
    public void tearDown() {
    }
}
